Dag Run and Overview Tab Display Deadlines#62195
Dag Run and Overview Tab Display Deadlines#62195imrichardwu wants to merge 20 commits intoapache:mainfrom
Conversation
This commit introduces a new `FailedIcon` component for representing failure states in the UI, along with a plugin for the DurationChart that visually indicates failed indices. The `FailedIcon` is created using Chakra UI's icon system, while the plugin draws a custom icon on the chart for failed data points.
|
@pierrejeambrun this is the PR to actually implement that endpoint you modified in #62374, if you can review when you get time. |
|
@imrichardwu - As I mentioned on Slack, I love how this looks in the screenshot, but the typescript/React stuff is well outside of my comfort zone to approve so I'll leave that for the others. The rendered result looks great to me though! |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Nice PR.
Overall looking good. Just a few suggestions/improvements.
|
I am struggling to understand the UX here.
Let me work on an issue for AIP-86's UI to make sure we are thinking this all through and developing enough API endpoints to support it. |
I don't see user having more than a couple. I don't know what the actual average number will be, but my expectation is under 5. That's why I didn't think the pagination was a major miss in his original code, but it can't hurt to have either way. The rest are UI/UX questions which aren't really my forte, I'll let you artists sort that part out, but I'll keep an eye here in case I can help at all. |
|
I wrote up my thoughts over in AIP-86 UI issue. |
5d348eb to
6c32415
Compare
- Introduce CalendarDeadlines component to display deadlines in the calendar view. - Implement DeadlineAlertsBadge to show alerts related to deadlines in the DAG header. - Create DagDeadlines component for overview page to list upcoming and missed deadlines. - Add DeadlineStatus component to show the status of deadlines in the run details. - Enhance i18n support for new deadline-related strings in dag.json.
…remove CalendarDeadlines component, and enhance deadline display with new modal and row components.
bbovenzi
left a comment
There was a problem hiding this comment.
Testing this all manually and I find the UX to still be a bit confusing. Let me try to provide some guidance.
-
Let's move all the python work in this PR to a separate PR that we merge before this. Then we can just focus on the UI here.
-
We can't rely on the name and description to tell a user what the alerts and deadlines are. We can do a better job of interpreting the reference and interval. For all cases of Met, Pending, and Missed. We should compare the alert's expected vs the dag run's actual. eg "Expected dag run finish: 1 hr after logical date. Actual dag run finish: 2 hours after logical date".
-
In the dag overview page, let's include the state of the dag run with each deadline so that I can, at a glance, know things like "Running dag with a missed deadline", "Successful run with a missed deadline"
Just showing a dag run id and a date is not sufficient information for a user to know what is going on.
…lerts, and introduce DeadlineStatusModal
… redundant description check
…plify alert retrieval logic
bbovenzi
left a comment
There was a problem hiding this comment.
Thanks for doing the human readable changes. I would still prefer that we split the python and UI changes into separate PRs.
There was a problem hiding this comment.
This file looks like a mistake?
There was a problem hiding this comment.
I split the pr. I should had @ you. And I do not think that is a mistake because the pre commit hook did that. I’m not too sure why cuz I tried getting rid of it every time and it just keeps creating it when I commit. I mention it in my note in the pr because I was kinda confuse why it did that.
There was a problem hiding this comment.
Yes, thanks I reviewed this before I saw your other PR.
There was a problem hiding this comment.
You can make this one change and skip the pre-commit checks with --no-verify
600cb9c to
fd76b5b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
airflow-core/src/airflow/serialization/encoders.py:170
- This PR is focused on UI changes for displaying DAG run deadlines, but it also modifies core trigger serialization behavior. Since this change is unrelated to the stated scope and could have broad impact on DAG serialization/deserialization, it would be safer to either justify the necessity in the PR description or move it into a separate PR with its own tests/validation.
def encode_trigger(trigger: BaseEventTrigger | dict):
from airflow.serialization.serialized_objects import BaseSerialization
def _ensure_serialized(d):
"""
Make sure the kwargs dict is JSON-serializable.
This is done with BaseSerialization logic. A simple check is added to
ensure we don't double-serialize, which is possible when a trigger goes
through multiple serialization layers.
"""
if isinstance(d, dict) and Encoding.TYPE in d:
return d
return BaseSerialization.serialize(d)
if isinstance(trigger, dict):
classpath = trigger["classpath"]
kwargs = trigger["kwargs"]
else:
classpath, kwargs = trigger.serialize()
return {
"classpath": classpath,
"kwargs": {k: _ensure_serialized(v) for k, v in kwargs.items()},
}
| {deadlines.map((dl) => { | ||
| const alert = | ||
| dl.alert_name !== undefined && dl.alert_name !== null && dl.alert_name !== "" | ||
| ? alertMap.get(dl.alert_name) | ||
| : undefined; | ||
| const deadlineTime = dayjs(dl.deadline_time); |
There was a problem hiding this comment.
The modal resolves dl.alert_name to a DeadlineAlertResponse via alertMap keyed on alert name. Since DeadlineAlert.name is nullable and not guaranteed unique, this lookup can be incorrect (collisions/overwrites) and show the wrong completion rule. Prefer using a stable identifier (e.g., alert UUID) from the deadline payload to map alerts to deadline instances.
| const alertMap = new Map<string, DeadlineAlertResponse>(); | ||
|
|
||
| for (const alert of alertData?.deadline_alerts ?? []) { | ||
| if (alert.name !== undefined && alert.name !== null && alert.name !== "") { | ||
| alertMap.set(alert.name, alert); | ||
| } | ||
| } |
There was a problem hiding this comment.
alertMap is keyed by alert.name and used to resolve deadline instances by dl.alert_name. Since DeadlineAlert.name is not enforced to be unique, this can mis-associate alerts when duplicate names exist. Prefer keying by a stable identifier (alert UUID) and consider updating the deadline API response to include the alert id so the UI can join reliably.
8e1fcaa to
a425539
Compare
blocked by #64926
PR scope change, so the branch name is a bit odd, but that's ok.
Implemented Dag run UI and Overview Tab base on the detail's at this PR(#50501 (comment))



Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.